:root {
  --bg: #0a0b0d;
  --surface: #121317;
  --surface-2: #171921;
  --text: #f2f3f5;
  --muted: #c9ccd3;
  --accent: #ff6a00; /* papaya-esque */
  --accent-2: #00e0ff; /* cool cyan line accent */
  --success: #4ade80;
  --danger: #ef4444;
  --shadow: rgba(0, 0, 0, 0.35);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --maxw: 1200px;
  --speed-1: 280ms;
  --speed-2: 480ms;
  --easing: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #08090b 0%, #0a0b0d 60%, #0c0e12 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

/* Accessibility helpers */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(1.2) blur(12px);
  background: rgba(10, 11, 13, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.site-header .brand {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 20px;
}
.logo-mark {
  width: 42px; height: 42px;
  border-radius: 50%;
  background:
    radial-gradient(80% 80% at 50% 50%, rgba(255,106,0,0.35) 0%, rgba(255,106,0,0) 70%),
    conic-gradient(from 160deg at 50% 50%, var(--accent), var(--accent-2), var(--accent));
  box-shadow: 0 8px 24px var(--shadow);
  animation: pulse 3.2s var(--easing) infinite;
}
@keyframes pulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.06); filter: hue-rotate(12deg); }
}
.brand-title {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin: 0;
}
.brand-subtitle {
  margin: 2px 0 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* Navigation */
.main-nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px 14px 20px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.nav-toggle {
  display: none;
}
.nav-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 20px; flex-wrap: wrap;
}
.nav-list a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--speed-1) var(--easing), transform var(--speed-1) var(--easing);
}
.nav-list a:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}

/* Hero section */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(1200px 400px at 0% 100%, rgba(255,106,0,0.15), transparent 60%),
    radial-gradient(800px 300px at 100% 0%, rgba(0,224,255,0.12), transparent 60%);
  opacity: 0.9;
}
.hero-content {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 60px 20px 48px 20px;
}
.hero-title {
  margin: 0 0 12px 0;
  font-size: clamp(28px, 5vw, 42px);
}
.hero-copy {
  margin: 0 0 18px 0;
  color: var(--muted);
}
.hero-cta {
  display: inline-block;
  padding: 10px 16px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #0a0b0d;
  font-weight: 700;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 24px rgba(0,224,255,0.25);
  text-decoration: none;
  transition: transform var(--speed-1) var(--easing);
}
.hero-cta:hover {
  transform: translateY(-2px);
}

/* Section title */
.section-title {
  max-width: var(--maxw);
  margin: 36px auto 6px auto;
  padding: 0 20px;
  font-size: clamp(22px, 3.6vw, 30px);
}
.section-subtitle {
  max-width: var(--maxw);
  margin: 0 auto 18px auto; padding: 0 20px;
  color: var(--muted);
}

/* Countdown */
.countdown-section {
  padding-bottom: 24px;
}
.countdown-grid {
  max-width: var(--maxw);
  margin: 12px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.count-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: 0 10px 24px var(--shadow);
  transform: translateY(6px);
  animation: liftIn var(--speed-2) var(--easing) forwards;
}
@keyframes liftIn {
  to { transform: translateY(0); opacity: 1; }
}
.count-value {
  font-size: clamp(26px, 5.5vw, 42px);
  font-weight: 700;
  letter-spacing: 1px;
}
.count-label {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}
.event-times {
  max-width: var(--maxw);
  margin: 12px auto 0 auto;
  padding: 0 20px;
  color: var(--muted);
}

/* News */
.news-section .news-list {
  max-width: var(--maxw);
  margin: 10px auto 0 auto;
  padding: 0 20px 20px 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.news-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 24px var(--shadow);
  transform: translateY(12px);
  opacity: 0;
  animation: newsIn var(--speed-2) var(--easing) forwards;
}
@keyframes newsIn {
  to { transform: translateY(0); opacity: 1; }
}
.news-media {
  height: 160px;
  background: linear-gradient(90deg, rgba(255,106,0,0.25), rgba(0,224,255,0.25));
}
.news-body {
  padding: 14px;
}
.news-title {
  margin: 0 0 6px 0;
  font-weight: 700;
}
.news-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}
.news-text {
  color: #e7e9ee;
  font-size: 15px;
  line-height: 1.5;
}

/* Tables shared */
.table-wrap {
  max-width: var(--maxw);
  margin: 12px auto 20px auto;
  padding: 0 20px;
}
.standings-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid rgba(255,255,255,0.06);
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 24px var(--shadow);
}
.standings-table thead th {
  text-align: left;
  padding: 12px;
  background: var(--surface-2);
  font-weight: 600;
  color: #e8ebf0;
}
.standings-table tbody td {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  vertical-align: middle;
}
.standings-table tbody tr {
  transition: background var(--speed-1) var(--easing);
}
.standings-table tbody tr:hover {
  background: rgba(255,255,255,0.04);
}
.driver-photo, .team-photo {
  width: 56px; height: 56px; border-radius: 8px; object-fit: cover;
  border: 1px solid rgba(255,255,255,0.08);
}

/* Calendar */
.calendar-grid {
  max-width: var(--maxw);
  margin: 8px auto 24px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.calendar-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 10px 24px var(--shadow);
  transform: translateY(10px);
  opacity: 0;
  animation: cardIn var(--speed-2) var(--easing) forwards;
}
@keyframes cardIn {
  to { transform: translateY(0); opacity: 1; }
}
.calendar-gp {
  margin: 0 0 6px 0; font-weight: 700;
}
.calendar-meta {
  color: var(--muted);
  font-size: 14px;
}

/* Results */
.results-controls {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px 10px 20px;
  display: flex;
  gap: 12px;
}
select {
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  border-radius: var(--radius-sm);
}
.hide-mobile {
  display: table-cell;
}
@media (max-width: 800px) {
  .hide-mobile { display: none; }
  .news-section .news-list { grid-template-columns: 1fr; }
  .calendar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .countdown-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-toggle { display: inline-block; padding: 8px 12px; }
  .main-nav { justify-content: space-between; }
  .nav-list {
    display: none;
    background: var(--surface);
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    position: absolute; right: 20px; top: 62px;
    z-index: 50;
  }
  .nav-list.open { display: grid; gap: 10px; }
}

/* Teams grid */
.team-cards {
  max-width: var(--maxw);
  margin: 8px auto 24px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 960px) {
  .team-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .team-cards { grid-template-columns: 1fr; }
}
.team-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 24px var(--shadow);
  cursor: pointer;
  transform: translateY(12px);
  opacity: 0;
  animation: teamIn var(--speed-2) var(--easing) forwards;
}
@keyframes teamIn {
  to { transform: translateY(0); opacity: 1; }
}
.team-card img {
  width: 100%; height: 160px; object-fit: cover;
}
.team-card .team-card-body {
  padding: 12px;
}
.team-card .team-name { margin: 0 0 6px 0; font-weight: 700; }
.team-card .team-blurb { color: var(--muted); font-size: 14px; }

/* Modal */
.team-modal {
  width: min(920px, 96vw);
  border: none; border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 40px 80px var(--shadow);
  padding: 0; overflow: hidden;
}
.team-modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
}
.modal-close {
  position: absolute; top: 12px; right: 12px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  font-size: 22px; line-height: 22px;
  width: 36px; height: 36px;
  cursor: pointer;
}
.modal-hero {
  position: relative; height: 240px; overflow: hidden;
}
.modal-hero img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.08);
  filter: saturate(1.1) contrast(1.05);
}
.modal-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.3), rgba(0,0,0,0.6)),
    radial-gradient(800px 300px at 100% 0%, rgba(0,224,255,0.15), transparent 60%);
}
.modal-hero h4 {
  position: absolute; bottom: 20px; left: 20px;
  margin: 0; font-size: 26px; z-index: 2;
}
.modal-tagline {
  position: absolute; bottom: 4px; left: 20px;
  margin: 0; color: var(--muted); z-index: 2; font-size: 14px;
}
.modal-content .modal-body {
  padding: 16px;
}
.modal-columns {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 14px;
}
.modal-list {
  list-style: none; margin: 0; padding: 0;
}
.modal-list li {
  padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.modal-history {
  line-height: 1.6; color: #e7e9ee; white-space: pre-wrap;
}

/* Footer */
.site-footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  background: #0a0b0d;
}
.footer-grid {
  max-width: var(--maxw);
  margin: 0 auto; padding: 24px 20px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
}
.footer-title { margin: 0 0 8px 0; }
.footer-bottom {
  max-width: var(--maxw);
  margin: 0 auto; padding: 0 20px 20px 20px;
  color: var(--muted);
}
